#include <xp/bas/string.h>
#include <xp/bas/stdlib.h>
#include <xp/bas/stdio.h>

int xp_main (int argc, xp_char_t* argv[])
{
	xp_size_t pos, count, n;

	if (argc != 4) {
		xp_printf (XP_TEXT("usage: %s string position count\n"), argv[0]);
		return -1;
	}

	XP_STRTOI (pos, argv[2], XP_NULL, 10);
	XP_STRTOI (count, argv[3], XP_NULL, 10);

	xp_printf (XP_TEXT("xp_strxdel (%s, %lu, %lu, %lu) => "), 
		argv[1], (unsigned long)xp_strlen(argv[1]),
		(unsigned long)pos, (unsigned long)count);
	n = xp_strxdel (argv[1], xp_strlen(argv[1]), pos, count);
	argv[1][n] = XP_CHAR('\0');
	xp_printf (XP_TEXT("[%s], %lu\n"), argv[1], (unsigned long)n);
 
	return 0;

}
